﻿// Copyright (c) Inossem. All rights reserved.
// Licensed under the LGPL-3.0 license. See LICENSE file in the project root for full license information.
using DWF.Studio.Custom;
using DWF.Studio.Models;
using DWF.Studio.Script;
using DWF.Studio.ScriptEngine.IPC;
using DWF.Studio.ScriptEngine.IPC.WorkFlow;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DWF.Studio.ISerivces
{
    /// <summary>
    /// 执行服务
    /// </summary>
    internal interface IExecutionService : IService
    {
        /// <summary>
        /// 获取当前状态
        /// </summary>
        /// <returns></returns>
        ExecuteStatus GetCurrentStatus();

        /// <summary>
        /// 执行脚本
        /// </summary>
        /// <param name="script"></param>
        void Execute(ScriptBase script);

        /// <summary>
        /// 调试脚本
        /// </summary>
        /// <param name="script"></param>
        void Debug(ScriptBase script);

        /// <summary>
        /// 调试
        /// </summary>
        void Debug();

        /// <summary>
        /// 单步调试
        /// </summary>
        /// <param name="script"></param>
        void DebugByStep(ScriptBase script);

        /// <summary>
        /// 单步调试
        /// </summary>
        void DebugByStep();

        /// <summary>
        /// 继续执行
        /// </summary>
        void Continue();

        /// <summary>
        /// 终结
        /// </summary>
        /// <param name="terminalScript"></param>
        /// <param name="location"></param>
        void Terminate(ScriptBase terminalScript, string location);
        /// <summary>
        /// 按照动态ID查询活动
        /// </summary>
        /// <param name="activityId"></param>
        void ActivitySelectionById(ScriptBase script,string activityId);
        /// <summary>
        /// 停止
        /// </summary>
        void Stop();

        /// <summary>
        /// 追踪信息
        /// </summary>
        /// <param name="stepInfo"></param>
        /// <returns></returns>
        IEnumerable<TrackingInfo> DebugTrackInfo(FrameInfoBase stepInfo);

        /// <summary>
        /// 追踪位置
        /// </summary>
        /// <param name="location"></param>
        /// <returns></returns>
        bool DebugTrackLocation(ScriptBase script, string location);

        /// <summary>
        /// 执行结束
        /// </summary>
        /// <param name="scriptShoweds"></param>
        void Finish(IEnumerable<ScriptBase> scriptShoweds);

        /// <summary>
        /// 刷新断点
        /// </summary>
        /// <param name="script"></param>
        void RefreshBreakpoints(ScriptBase script);
    }
}
